﻿/* ── Trang chủ / trang nội dung chính ── */

/* Hero banner */
.hero-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    margin-bottom: 24px;
    background: #1e3a5f;
    border-radius: 16px;
    border: 1px solid #1e40af;
}

.hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #1d4ed8;
    border: 1px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #bfdbfe;
    flex-shrink: 0;
}

.hero-content h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e0eeff;
}

.hero-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #93c5fd;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.15s;
}

    .hero-btn:hover {
        transform: translateY(-2px);
    }

    .hero-btn.primary {
        background: #1d4ed8;
        color: #fff;
    }

    .hero-btn.secondary {
        background: #1e40af;
        color: #bfdbfe;
        border: 1px solid #3b82f6;
    }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    transition: border-color 0.15s, transform 0.15s;
}

    .stat-card:hover {
        border-color: #3b82f6;
        transform: translateY(-2px);
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

    .stat-icon.blue {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .stat-icon.green {
        background: #dcfce7;
        color: #166534;
    }

    .stat-icon.amber {
        background: #fef9c3;
        color: #854d0e;
    }

    .stat-icon.purple {
        background: #ede9fe;
        color: #5b21b6;
    }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: #3b82f6;
    margin-top: 3px;
    font-weight: 500;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card chung */
.d-card {
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 22px 24px;
}

.d-card__head {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3b82f6;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eff6ff;
}

/* Row trong card */
.d-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eff6ff;
    font-size: 0.875rem;
}

    .d-row:last-child {
        border: none;
    }

.d-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .d-dot.blue {
        background: #1d4ed8;
    }

    .d-dot.green {
        background: #16a34a;
    }

    .d-dot.amber {
        background: #d97706;
    }

.d-label {
    flex: 1;
    color: #1e3a5f;
    font-weight: 500;
}

.d-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
}

    .d-tag.blue {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .d-tag.green {
        background: #f0fdf4;
        color: #166534;
    }

    .d-tag.amber {
        background: #fffbeb;
        color: #92400e;
    }

    .d-tag.red {
        background: #fef2f2;
        color: #991b1b;
    }

/* Quick actions */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    text-decoration: none;
    color: #1e3a5f;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

    .quick-card i {
        font-size: 1.4rem;
        color: #1d4ed8;
    }

    .quick-card:hover {
        background: #dbeafe;
        border-color: #3b82f6;
        transform: translateY(-2px);
        color: #1e3a5f;
        text-decoration: none;
    }

/* Alert items */
.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
}

    .alert-item:last-child {
        margin: 0;
    }

    .alert-item i {
        font-size: 1.1rem;
    }

    .alert-item.warning {
        background: #fffbeb;
        color: #92400e;
        border: 1px solid #fde68a;
    }

    .alert-item.danger {
        background: #fef2f2;
        color: #991b1b;
        border: 1px solid #fecaca;
    }

    .alert-item.success {
        background: #f0fdf4;
        color: #166534;
        border: 1px solid #bbf7d0;
    }

/* Responsive */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-content h1 {
        font-size: 1.2rem;
    }
}
/* ==========================================
       THỜI KHÓA BIỂU HÔM NAY
       ========================================== */
.tkb-table-wrapper {
    overflow-x: auto;
}

.tkb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

    .tkb-table thead th {
        padding: 12px 10px;
        background: #eff6ff;
        color: #2563eb;
        font-size: .85rem;
        font-weight: 700;
        text-align: center;
        border-bottom: 1px solid #dbeafe;
    }

    .tkb-table tbody td {
        padding: 10px 8px;
        text-align: center;
        vertical-align: middle;
        border-bottom: 1px solid #f1f5f9;
        border-right: 1px solid #f1f5f9;
    }

    .tkb-table tbody tr:last-child td {
        border-bottom: none;
    }

    .tkb-table tbody td:last-child {
        border-right: none;
    }

    .tkb-table tbody tr:hover {
        background: #f8fafc;
    }

.tiet-col {
    width: 70px;
    background: #fafcff;
    color: #2563eb;
    font-size: .85rem;
    font-weight: 700;
}

.mon-hoc {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .82rem;
    font-weight: 600;
}

.giao-vien {
    margin-top: 4px;
    font-size: .72rem;
    color: #64748b;
}

.empty-state {
    padding: 30px;
    text-align: center;
    color: #94a3b8;
}

.fake-chart {
    height: 220px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px;
}

.bar {
    flex: 1;
    border-radius: 12px 12px 0 0;
    background: linear-gradient( 180deg, #60a5fa, #2563eb );
}


/* ============================================================
   Home.mobile.css  –  Mobile override (≤ 768px / ≤ 480px)
   Import SAU file gốc. Không sửa file gốc.
   ============================================================ */

/* ── Reset quan trọng: chặn overflow toàn trang ─────────── */
.dashboard-home {
    overflow-x: hidden; /* nguồn gốc của tràn ngang */
}

/* ══════════════════════════════════════════════════════════
   1. BASE MOBILE  (≤ 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Wrapper ──────────────────────────────────────────── */
    .dashboard-home {
        padding: 0 10px 24px;
    }

    /* ── HERO ─────────────────────────────────────────────── */
    .hero-section {
        flex-direction: row; /* icon + text cùng hàng */
        align-items: flex-start;
        padding: 14px 14px;
        gap: 10px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .hero-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .hero-content {
        flex: 1;
        min-width: 0; /* chặn flex-child đẩy rộng */
    }

        .hero-content h1 {
            font-size: 0.95rem;
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hero-content p {
            font-size: 0.75rem;
            line-height: 1.5;
            margin-top: 4px;
        }

    /* Buttons: chỉ icon – kích thước rõ ràng, không dùng auto */
    .hero-actions {
        margin-top: 10px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .hero-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0;
        border-radius: 8px;
        justify-content: center;
        gap: 0;
    }

        .hero-btn span {
            display: none;
        }

        .hero-btn i {
            font-size: 1rem;
            margin: 0;
        }

    /* ── STATS GRID ────────────────────────────────────────── */
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax(0) chặn tràn */
        gap: 8px;
        margin-bottom: 12px;
    }

    .stat-card {
        padding: 10px 10px;
        gap: 8px;
        border-radius: 10px;
        min-width: 0; /* chặn flex/grid item tràn */
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .stat-value {
        font-size: 1.25rem;
        line-height: 1;
    }

    .stat-label {
        font-size: 0.65rem;
        margin-top: 2px;
    }

    /* ── DASHBOARD GRID ────────────────────────────────────── */
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr); /* minmax(0) bắt buộc */
        gap: 12px;
    }

    .dashboard-col {
        gap: 12px;
        min-width: 0;
    }

    /* ── CARD ──────────────────────────────────────────────── */
    .d-card {
        padding: 14px 12px;
        border-radius: 10px;
        min-width: 0;
    }

    .d-card__head {
        font-size: 0.65rem;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    /* ── QUICK ACCESS: 5 icon trên 1 hàng ─────────────────── */
    .quick-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }

    .quick-card {
        padding: 10px 4px;
        border-radius: 8px;
        gap: 4px;
        min-width: 0;
    }

        .quick-card span {
            display: none; /* ẩn nhãn, chỉ icon */
        }

        .quick-card i {
            font-size: 1.2rem;
        }

    /* ── TKB TABLE ─────────────────────────────────────────── */
    /*
     *  Wrapper phải là khối định kích thước rõ ràng.
     *  overflow-x: auto chỉ hoạt động khi wrapper KHÔNG bị kéo rộng
     *  bởi con – dùng max-width: 100% để đảm bảo.
     */
    .tkb-table-wrapper {
        position: relative;
        max-width: 100%; /* không được vượt quá cha */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }

        /* Fade gợi ý scroll */
        .tkb-table-wrapper::after {
            content: "";
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 24px;
            background: linear-gradient(to left, rgba(255,255,255,.85), transparent);
            pointer-events: none;
            border-radius: 0 10px 10px 0;
        }

    .tkb-table {
        min-width: 360px; /* đủ 3 lớp, không cần rộng hơn */
        width: 100%;
        table-layout: fixed; /* cột không tự giãn vô hạn */
        font-size: 0.72rem;
    }

        .tkb-table thead th {
            padding: 8px 4px;
            font-size: 0.68rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tkb-table tbody td {
            padding: 7px 4px;
        }

    /* Cột tiết cố định hẹp */
    .tiet-col {
        width: 36px;
        font-size: 0.72rem;
    }

    .mon-hoc {
        padding: 2px 6px;
        font-size: 0.68rem;
    }

    .giao-vien {
        font-size: 0.62rem;
        margin-top: 2px;
    }

    /* ── ALERT ITEMS ───────────────────────────────────────── */
    .alert-item {
        padding: 9px 10px;
        font-size: 0.78rem;
        gap: 8px;
        border-radius: 8px;
        margin-bottom: 6px;
    }

        .alert-item i {
            font-size: 0.9rem;
            flex-shrink: 0;
        }

    /* ── TIMELINE ──────────────────────────────────────────── */
    .timeline-item {
        font-size: 0.78rem;
    }

    /* ── FAKE CHART ────────────────────────────────────────── */
    .fake-chart {
        height: 140px;
        padding: 10px 8px;
        gap: 8px;
    }

    .bar {
        border-radius: 6px 6px 0 0;
    }

    /* ── RECENT ACTIVITY ───────────────────────────────────── */
    .d-label {
        font-size: 0.78rem;
    }

    .d-row {
        font-size: 0.8rem;
        padding: 8px 0;
        gap: 10px;
    }
}

/* ══════════════════════════════════════════════════════════
   2. SMALL PHONES  (≤ 480px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    .dashboard-home {
        padding: 0 8px 20px;
    }

    /* Stats */
    .stats-grid {
        gap: 6px;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    /* Quick access */
    .quick-grid {
        gap: 5px;
    }

    .quick-card {
        padding: 8px 3px;
    }

        .quick-card i {
            font-size: 1.1rem;
        }

    /* Hero */
    .hero-section {
        padding: 12px 10px;
    }

    .hero-content h1 {
        font-size: 0.88rem;
    }

    .hero-content p {
        font-size: 0.72rem;
    }

    .hero-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    /* TKB: 3 lớp vừa đủ ở 360px */
    .tkb-table {
        min-width: 320px;
        font-size: 0.68rem;
    }

    .tiet-col {
        width: 30px;
    }

    .mon-hoc {
        font-size: 0.62rem;
        padding: 2px 4px;
    }

    .giao-vien {
        font-size: 0.58rem;
    }

    /* Alerts */
    .alert-item {
        font-size: 0.74rem;
        padding: 8px 8px;
    }

    /* Chart */
    .fake-chart {
        height: 120px;
        gap: 6px;
    }
}